Convert test framework from Mocha/Chai to Vitest and update CI workflows#35
Merged
Convert test framework from Mocha/Chai to Vitest and update CI workflows#35
Conversation
Co-authored-by: dgreif <3026298+dgreif@users.noreply.github.com>
Co-authored-by: dgreif <3026298+dgreif@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Update testing framework to use Vitest and remove deprecated packages
Convert test framework from Mocha/Chai to Vitest and update CI workflows
Oct 7, 2025
dgreif
reviewed
Oct 8, 2025
Co-authored-by: dgreif <3026298+dgreif@users.noreply.github.com>
There was a problem hiding this comment.
Pull Request Overview
This PR migrates the testing infrastructure from Mocha/Chai to Vitest v3.2.4 and updates CI workflows to use Node.js 24.
- Replaces Mocha/Chai test framework with Vitest for modern TypeScript testing
- Updates Node.js version to 24 in GitHub Actions workflows
- Removes outdated dependencies and configurations while adding Playwright support
Reviewed Changes
Copilot reviewed 6 out of 8 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| vitest.config.ts | Adds Vitest configuration for TypeScript test execution |
| test/index.ts | Converts Chai assertions to Vitest syntax and spy functions |
| test/decorator.ts | Updates test assertions from Chai to Vitest format |
| package.json | Removes Mocha/Chai dependencies, adds Vitest, updates TypeScript and Node types |
| .github/workflows/publish.yml | Updates Node.js to v24 and adds Playwright installation |
| .github/workflows/nodejs.yml | Updates Node.js to v24 and adds Playwright installation |
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
dgreif
reviewed
Oct 9, 2025
.github/workflows/nodejs.yml
Outdated
| with: | ||
| node-version: 22 | ||
| node-version: 24 | ||
| - run: npx playwright install chromium |
Contributor
There was a problem hiding this comment.
@copilot we actually don't need playwright since we aren't using browser mode. Remove all installs in ci
Contributor
Author
There was a problem hiding this comment.
Removed playwright install steps from both nodejs.yml and publish.yml workflows. (commit: will be included in next push)
Co-authored-by: dgreif <3026298+dgreif@users.noreply.github.com>
dgreif
approved these changes
Oct 9, 2025
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR modernizes the testing infrastructure by migrating from Mocha/Chai to Vitest v3.2.4, and updates GitHub Actions workflows to use the latest Node.js versions.
Test Framework Migration
Removed dependencies:
mocha,chai,chai-spies,ts-nodeand related@typespackagesAdded:
vitest@^3.2.4with proper TypeScript supportTest files updated:
All test files (
test/index.ts,test/decorator.ts) have been converted from Chai assertions to Vitest:Configuration changes:
vitest.config.tsfor Vitest configurationnode --loader ts-node/esm.mjs node_modules/mocha/lib/cli/cli.jstovitest runpackage.jsonDependency Updates
typescriptfrom^4.6.4to^5.9.3for better compatibility@types/nodefrom^14.0.19to^22.18.8to match Node.js 24 requirementsskipLibCheck: truetotsconfig.jsonto handle type definitions in node_modulesGitHub Actions Workflows
nodejs.yml:
publish.yml:
Both workflows already used the latest versions of
actions/checkout@v4andactions/setup-node@v4.Validation
All existing tests pass successfully:
Original prompt
💬 Share your feedback on Copilot coding agent for the chance to win a $200 gift card! Click here to start the survey.